package com.starsola.cloud.productapi.entity;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

@Getter@Setter
@AllArgsConstructor
@NoArgsConstructor
@RequiredArgsConstructor(staticName = "of")
@Accessors(chain = true)
public class Product {
    private Long id;
    @NonNull
    private String name; // 商品名称
    private int price; // 商品价格
    private int stock; // 商品库存

    public static void main(String[] args) {
        // test Lombok
        Product a = Product.of("产品A").setPrice(998);
        System.out.println(a.getName());
        System.out.println(a.getPrice());
    }
}
